# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>
# Contributor: Eli Schwartz <eschwartz@archlinux.org>

_name=flit
pkgname=python-flit
pkgver=3.8.0
pkgrel=4
pkgdesc='Simplified packaging of Python modules'
arch=('any')
url='https://github.com/pypa/flit'
license=('BSD')
depends=('python' 'python-docutils' 'python-flit-core' 'python-requests' 'python-tomli-w')
makedepends=('python-build' 'python-installer')
checkdepends=('python-pip' 'python-pytest' 'python-responses' 'python-testpath')
source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
sha512sums=('c4af79e1511e647303dc6b0913d8526586580db8d916aa7c4a52a9ebb281b375b6082e961ac8be05c0fc8ffdd8c3ec858fcba4e7faea25f465895288fa09c355')
b2sums=('f0f5c7d85e93423b34ff1af834fc1724d49ca9ffa9d7f89be43c1e604804abbdd1407df56b599b8a709b789f7915953e46282b068dbc0f255b4e43cc0630f9cf')

build() {
  cd $_name-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd $_name-$pkgver
  pytest -vv
}

package_python-flit() {
  cd $_name-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
}
